package router

import (
	"context"
	"github.com/gin-gonic/gin"
	v1 "go-mall/api/goodsserver/v1"
	"go-mall/app/goodsserver-svc/internal/service"
	"go-mall/libs/response"
)

var (
	goodsService = service.NewGoodsService()
)

func v1api(group *gin.RouterGroup) {
	group.GET("/test", TestHelloworld)
}

func TestHelloworld(c *gin.Context) {
	var req v1.ListGoodsRequest
	defer c.Request.Body.Close()
	resp, _ := goodsService.ListGoods(context.Background(), &req)
	response.NewSuccess(c, resp)
}
